#include "cpu/exec/helper.h"




bool je_check(){
    return cpu.eflags.ZF==1;
}

bool jbe_check(){
    return cpu.eflags.ZF==1||cpu.eflags.CF==1;
}

bool jne_check(){
    return cpu.eflags.ZF==0;
}

bool jle_check(){
    return cpu.eflags.ZF==1||cpu.eflags.SF ^ cpu.eflags.OF;
}

bool jg_check(){
    return !(cpu.eflags.ZF|(cpu.eflags.SF ^ cpu.eflags.OF));
}

bool jl_check(){
    return cpu.eflags.SF ^ cpu.eflags.OF;
}

bool js_check(){
    return cpu.eflags.SF;
}

bool jns_check(){
    return !cpu.eflags.SF;
}

bool jge_check(){
    return !(cpu.eflags.SF^cpu.eflags.OF);
}

bool ja_check(){
    return !cpu.eflags.CF & !cpu.eflags.ZF;
}

bool jb_check(){
    return cpu.eflags.CF;
}

#define DATA_BYTE 1
#include "jcc-template.h"
#undef DATA_BYTE

#define DATA_BYTE 2
#include "jcc-template.h"
#undef DATA_BYTE

#define DATA_BYTE 4
#include "jcc-template.h"
#undef DATA_BYTE

make_jcc_helper_v(e);
make_jcc_helper_v(be);
make_jcc_helper_v(ne);
make_jcc_helper_v(le);
make_jcc_helper_v(g);
make_jcc_helper_v(l);
make_jcc_helper_v(s);
make_jcc_helper_v(ns);
make_jcc_helper_v(ge);
make_jcc_helper_v(a);
make_jcc_helper_v(b);